package com.google.code.jholidays.exceptions;

import com.google.code.jholidays.core.EventBuilder;
import com.google.code.jholidays.core.EventDescriptor;
import com.google.code.jholidays.events.IEvent;

/**
 * Thrown when {@link EventBuilder} can't build {@link IEvent} using it's
 * {@link EventDescriptor}
 * 
 * @author tillias
 * 
 */
public class NotSupportedEventException extends Exception {

    /**
     * Creates new instance of exception using given text message and event
     * descriptor
     * 
     * @param message
     *            The detail message.
     * @param descriptor
     *            Event descriptor which caused this exception
     */
    public NotSupportedEventException(String message, EventDescriptor descriptor) {
	super(message);

	this.descriptor = descriptor;
    }

    /**
     * Gets event descriptor associated with given exception
     * 
     * @return Event descriptor which caused this exception
     */
    public EventDescriptor getEventDescriptor() {
	return descriptor;
    }

    /**
     * 
     */
    private static final long serialVersionUID = -8894969522421800631L;

    protected EventDescriptor descriptor;
}
